<template>
  <div style="margin: 20px"></div>
  <el-form
    :label-position="labelPosition"
    label-width="100px"
    :model="formLabelAlign"
    style="max-width: 300px"
  >
    <el-form-item label="用户名">
      <el-input v-model="formLabelAlign.username"></el-input>
    </el-form-item>
    <el-form-item label="密码">
      <el-input v-model="formLabelAlign.password" type="password"></el-input>
    </el-form-item>
    <el-form-item label="验证码">
      <el-input v-model="formLabelAlign.imgcode"></el-input>
      <el-image
        style="width: 100px; height: 50px"
        src="http://passport2.chaoxing.com/num/code?1646558649221"
      ></el-image>
    </el-form-item>

    <el-form-item>
      <el-checkbox v-model="formLabelAlign.keep">保持登录</el-checkbox>
    </el-form-item>
    <el-form-item>
      <el-button size="large" type="primary" @click="$emit('saved')">登录</el-button>
    </el-form-item>
  </el-form>
</template>

<script lang="ts" setup>
import { ElMessage } from "element-plus/lib/components";
import { reactive, ref } from "vue";

const labelPosition = ref("right");

const formLabelAlign = reactive({
  username: "",
  password: "",
  imgcode: "",
  keep: false,
});

</script>